package graphique;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JList;
import javax.swing.JPanel;

import modele.Contact;

public class DetailContact extends JList{

	private static final long serialVersionUID = 1L;
	
	
	public DetailContact() {
		super();
	}
	
	
	public void afficherDetail(Contact contact) {

		DefaultListModel model = new DefaultListModel();
		String value = "Nom:           " + contact.getNom();
		model.addElement(value);
		value = "Prenom:        " + contact.getPrenom();
		model.addElement(value);
		value = "Adresse:       " + contact.getAdresse() + " " + contact.getVille() + " " + contact.getPays();
		model.addElement(value);
		value = "Email:         " + contact.getEmail();
		model.addElement(value);
		value = "Portable:      " + contact.getPortable();
		model.addElement(value);
		value = "Fixe:          " + contact.getFixe();
		model.addElement(value);
		
		
		
		setModel(model);
		setVisible(true);
	}
}
